package com.giscloud.amp.service.regis.impl;

import com.giscloud.amp.core.ServiceConstConfig;
import com.giscloud.amp.entity.regis.dto.DpRoleProjectDTO;
import com.giscloud.amp.service.regis.DpRoleProjectService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author:gxd
 * @Description: 权限服务类
 * @Date: 17:19 2018/2/24
 * @Modified By:
 */
@Service("dpRoleProjectServiceImpl")
public class DpRoleProjectServiceImpl implements DpRoleProjectService {

    private final static Logger log = LoggerFactory.getLogger(DpRoleProjectServiceImpl.class);

    @Autowired
    private ServiceConstConfig commConstConfig;

    @Override
    public int save(DpRoleProjectDTO dpRoleProjectDTO) {
//        String param = "projectId="+dpRoleProjectDTO.getProjectId()+
//                "&roleIdList="+dpRoleProjectDTO.getRoleIds().toString()+
//                "&staffId="+dpRoleProjectDTO.getCreateStaffId();
//        String result = HttpRequest.sendPost(commConstConfig.getDpUrl()+"dpAmpApi/save.do",param);
//        return Integer.parseInt(result);
        return -1;
    }

    @Override
    public int delete(DpRoleProjectDTO dpRoleProjectDTO) {
//        String param = "projectId="+dpRoleProjectDTO.getProjectId()+
//                "&roleIdList="+dpRoleProjectDTO.getRoleIds().toString()+
//                "&staffId="+dpRoleProjectDTO.getCreateStaffId();
//        String result = HttpRequest.sendPost(commConstConfig.getDpUrl()+"dpAmpApi/delete.do",param);
//        return Integer.parseInt(result);
        return -1;
    }

    @Override
    public List<Long> findRoleProjectByProject(DpRoleProjectDTO dpRoleProjectDTO) {
//        String param = "projectId="+dpRoleProjectDTO.getProjectId();
//        String result = HttpRequest.sendPost(commConstConfig.getDpUrl()+"dpAmpApi/findRoleProjectByProject.do",param);
//        Gson gson = new Gson();
//        List<Long> list = gson.fromJson(result,List.class);
        return new ArrayList<>();
    }

}
